﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DSS_XNA.Engine.Error;
using DSS_XNA.Engine.Entities;

namespace DSS_XNA.Engine.Script.Commands
{
    public static class ScriptCommand_SetWorldFocusedEntity
    {
        #region Static Methods

        public static void Action(Dictionary<string, string> args, ScriptManager manager, Game1 engine)
        {
            if (!args.ContainsKey("name"))
                throw new DSSException("No name parameter for SetWorldFocusedObject");

            string name = Convert.ToString(manager.GetParameterValue(args["name"]));

            Entity e = EntityManager.Get(name);
            if (e == null)
                throw new DSSException("'e' is null.");

            engine.CurrentWorld.CurrentWorld.FocusedEntity = e;
        }

        #endregion
    }
}
